<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        r = 100; jd = 0;
        x0 = 300 + r;
        y0 = 300 + 0;
        cxt.moveTo(x0, y0);
        while(jd <= 3.1415926*2){
            jd = jd + 0.01;
            x1 = 300 + r*2*Math.cos(jd)*Math.sin(3*jd);
            y1 = 300 + r*2*Math.sin(jd)*Math.sin(3*jd);
            cxt.lineTo(x1, y1);
        }
        cxt.stroke();
    </script>
</body>
</html>